package org.apache.lucene.store.entity;

import java.io.IOException;

import org.apache.lucene.store.IndexInput;

import com.edocbase.entity.file.ChunkInputStream;
import com.edocbase.entity.file.EntityFile;

public class EntityInput extends IndexInput {
	private EntityFile file = null;
	private ChunkInputStream input;
	
	public EntityInput(EntityFile file) {
		super();
		this.file = file;
		input = (ChunkInputStream) this.file.getInputStream();
	}
	@Override
	public byte readByte() throws IOException {
		return (byte) input.read();
	}

	@Override
	public void readBytes(byte[] b, int offset, int len) throws IOException {
		input.read(b, offset, len);
	}

	@Override
	public void close() throws IOException {
		input.close();
	}


	@Override
	public long getFilePointer() {
		return input.getFilePointer();
	}

	@Override
	public void seek(long pos) throws IOException {
		input.seek(pos);
	}

	@Override
	public long length() {
		return input.length();
	}

}
